﻿using System;
using System.IO;
namespace DbfReader
{
    internal class RecordDescription
    {
        public string recordName { get; set; }
        public char recordType { get; set; }
        private byte[] unUse1;
        public int recordItemLength { get; set; }
        private Int16 recordItemPrecision;
        private byte[] unUse2;
        private int workspaceId;
        private byte[] unUse3;
        private byte mdxFlag;

        public RecordDescription()
        { }

        public void Read(BinaryReader binaryReader)
        {
            for (int i = 0; i < 11; i++)
            {
                char name = binaryReader.ReadChar();
                recordName = recordName + name;
            }
            recordType = binaryReader.ReadChar();
            unUse1 = binaryReader.ReadBytes(4);
            recordItemLength = (int)binaryReader.ReadByte();
            recordItemPrecision = (Int16)binaryReader.ReadByte();
            unUse2 = binaryReader.ReadBytes(2);
            workspaceId = binaryReader.ReadByte();
            unUse3 = binaryReader.ReadBytes(10);
            mdxFlag = binaryReader.ReadByte();
        }
    }
}
